package priv.pattern.compositemode.service.impl;

import priv.pattern.compositemode.service.BaseShape;

import java.awt.*;

/*
 * 作者：m鹏h
 * 时间；2024/8/5 18:00
 * 描述：圆
 **/
public class Circle extends BaseShape {
 public int radius;

 public Circle(int x, int y, int radius, Color color) {
  super(x, y, color);
  this.radius = radius;
 }

 @Override
 public int getWidth() {
  return radius * 2;
 }

 @Override
 public int getHeight() {
  return radius * 2;
 }

 public void paint(Graphics graphics) {
  super.paint(graphics);
  graphics.drawOval(x, y, getWidth() - 1, getHeight() - 1);
 }
}
